/**
 * 定义页面对应的后台处理类完整路径。
 */
var clsUrl = basePath + 'JarpListener?className=cn.com.zsc.hr.EmployeeMessages';

Ext.onReady(function(){
	Ext.QuickTips.init();

	/**
	 * 订立合同时间控件
	 */
	var startDate = new Ext.form.DateField({
		id:'startDate',
        fieldLabel:"订立合同时间",
        name:'signDate',
        format:'Y-m-d',
        editable:false,
        width:90
    });
    
    /**
	 * 订立合同时间控件
	 */
	var endDate = new Ext.form.DateField({
		id:'endDate',
        fieldLabel:"至",
        name:'signDate',
        format:'Y-m-d',
        editable:false,
        width:90
    });
    
    /**
	 * 是否编制人员数据源
	 */
	var isFormalStore=new Ext.data.Store({
		proxy : new Ext.data.HttpProxy({
			url : comboBoxUrl + '12'
		}),
		reader : new Ext.data.JsonReader({
			fields : [
			{name:'CL_CODE'},
			{name:'CL_NAME'}
		]
		}),
		autoLoad : true
	});
	
	/**
	 * 是否编制人员控件
	 */
	var isFormal = new Ext.form.ComboBox({
		fieldLabel : '是否编制人员',
		id : 'isFormal',
		width : 90,
		displayField : 'CL_NAME',
		valueField : 'CL_CODE',
		emptyText : '请选择',
		store:isFormalStore,
		mode : 'local',
		editable  : false,
		triggerAction : 'all',
		selectOnFocus : true
	});
	
	/**
	 * 是否离职数据源
	 */
	var leftJobStore=new Ext.data.Store({
		proxy : new Ext.data.HttpProxy({
			url : comboBoxUrl + '12'
		}),
		reader : new Ext.data.JsonReader({
			fields : [
			{name:'CL_CODE'},
			{name:'CL_NAME'}
		]
		}),
		autoLoad : true,
		listeners:{'load':function() {
				Ext.getCmp("leftJob").setValue(Ext.getCmp("leftJob").getValue());
			}
		}
	});
	
	/**
	 * 是否离职控件
	 */
	var leftJob = new Ext.form.ComboBox({
		fieldLabel : '是否离职',
		id : 'leftJob',
		width : 90,
		displayField : 'CL_NAME',
		valueField : 'CL_CODE',
		emptyText : '请选择',
		store:leftJobStore,
		mode : 'local',
		editable  : false,
		triggerAction : 'all',
		selectOnFocus : true,
		listeners:{'render':function() {
				this.setValue(41);
				Ext.getCmp("leftJob").getStore().reload();
			}
		}
	});
	
	/**
	 * 合同性质数据源
	 */
	var contractStore=new Ext.data.Store({
		proxy : new Ext.data.HttpProxy({
			url : comboBoxUrl + '10'
		}),
		reader : new Ext.data.JsonReader({
			fields : [
			{name:'CL_CODE'},
			{name:'CL_NAME'}
		]
		}),
		autoLoad : true
	});
	
	/**
	 * 合同性质控件
	 */
	var contractComboBox = new Ext.form.ComboBox({
		fieldLabel : '合同性质',
		id : 'contract',
		width : 90,
		displayField : 'CL_NAME',
		valueField : 'CL_CODE',
		emptyText : '请选择',
		store:contractStore,
		mode : 'local',
		editable  : false,
		triggerAction : 'all',
		selectOnFocus : true
	});
	
	/**
	 * 员工星级数据源
	 */
	var estarLevelStore=new Ext.data.Store({
		proxy : new Ext.data.HttpProxy({
			url : comboBoxUrl + '7'
		}),
		reader : new Ext.data.JsonReader({
			fields : [
			{name:'CL_CODE'},
			{name:'CL_NAME'}
		]
		}),
		autoLoad : true
	});
	
	/**
	 * 员工星级控件
	 */
	var starLevelComboBox = new Ext.form.ComboBox({
		fieldLabel : '员工星级',
		id : 'starLevel',
		width : 90,
		displayField : 'CL_NAME',
		valueField : 'CL_CODE',
		emptyText : '请选择',
		store:estarLevelStore,
		mode : 'local',
		editable  : false,
		triggerAction : 'all',
		selectOnFocus : true
	});
	
	/**
	 * 组别数据源
	 */
	var termStore=new Ext.data.Store({
		proxy : new Ext.data.HttpProxy({
			url : comboBoxUrl + '15'
		}),
		reader : new Ext.data.JsonReader({
			fields : [
			{name:'CL_CODE'},
			{name:'CL_NAME'}
		]
		}),
		autoLoad : true
	});
	
	/**
	 * 组别控件
	 */
	var termComboBox = new Ext.form.ComboBox({
		fieldLabel : '组别',
		id : 'term',
		width : 90,
		displayField : 'CL_NAME',
		valueField : 'CL_CODE',
		emptyText : '请选择',
		store:termStore,
		mode : 'local',
		editable  : false,
		triggerAction : 'all',
		selectOnFocus : true
	});
   
	var storereader= new Ext.data.JsonReader({
    	fields:[
    		{name :'EID'},
    		{name :'WORKID'},
    		{name :'ENAME'},
    		{name :'SEX'},
    		{name :'AGE'},
    		{name :'SINO'},
    		{name :'ICNO'},
    		{name :'RPRADD'},
    		{name :'LIVEADD'},
    		{name :'TEL'},
    		{name :'EPMODE'},
    		{name :'SIGNDATE'},
    		{name :'TLIMIT'},
    		{name :'STARLEVEL'},
    		{name :'PVISAGE'},
    		{name :'TPOST'},
    		{name :'DEPT'},
    		{name :'CONTRACT'},
    		{name :'GSCH'},
    		{name :'EDUCATION'},
    		{name :'CCARD'},
    		{name :'ELEVEL'},
    		{name :'MLEVEL'},
    		{name :'RP'},
    		{name :'TERM'},
    		{name :'FNAME'},
    		{name :'FAGE'},
    		{name :'FRELATION'},
    		{name :'FUNITS'},
    		{name :'PHOTO'},
    		{name :'REMARKED'},
    		{name :'POST'},
    		{name :'DUTIES'},
    		{name :'BIRTHDAY'},
    		{name :'HEIGHT'},
    		{name :'ARRDATE'},
    		{name :'LIMITDATE'},
    		{name :'SPECIALTY'},
    		{name :'WORKAGE'},
    		{name :'LEFTJOB'},
    		{name :'SPECIAL'},
    		{name :'INDATE'},
    		{name :'GRADUATION'},
    		{name :'AGREEMENT'},
    		{name :'ENDDATE'},
    		{name :'TEACHER'},
    		{name :'INSURANCE'},
    		
    		
    		{name :'SHOW_SEX'},
    		{name :'SHOW_EPMODE'},
    		{name :'SHOW_STARLEVEL'},
    		{name :'SHOW_PVISAGE'},
    		{name :'SHOW_DEPT'},
    		{name :'SHOW_CONTRACT'},
    		{name :'SHOW_EDUCATION'},
    		{name :'SHOW_CCARD'},
    		{name :'SHOW_ELEVEL'},
    		{name :'SHOW_MLEVEL'},
    		{name :'SHOW_TERM'},
    		{name :'SHOW_POST'},
    		{name :'SHOW_DUTIES'},
    		{name :'SHOW_LEFTJOB'},
    		{name :'SHOW_INSURANCE'}
    	]
	});
		
	/**
	 * 查询员工数据
	 */
	var store = new Ext.data.Store({
		reader:storereader,
		proxy:new Ext.data.HttpProxy({
			url:clsUrl+'&methodName=getEmployee&&paramCount=0'
		})
	});
     
    var searchPanel = new Ext.Panel({
		id:"searchPanel",
		region:"north",
		border:false,
		layout : 'column',
		labelAlign : 'right',
		height:80,
		frame:true,
		labelWidth : 80,
		items:[{
			layout : 'form',
			border:false,
		  	labelWidth : 40,
		  	labelAlign : 'right',
		  	columnWidth : .15,
		  	items:[
		  		   {fieldLabel : '姓名',width : 100,name : 'eName',id : 'eName',xtype : 'textfield'},
		  		   {fieldLabel : '工号',width : 100,name : 'workID',id : 'workID',xtype : 'textfield'}
		  		  ]
		},{
			layout : 'form',
		  	labelWidth : 60,
		  	labelAlign : 'right',
		  	columnWidth : .17,
		  	items:[starLevelComboBox,termComboBox]
		},{
			layout : 'form',
		  	labelWidth : 60,
		  	labelAlign : 'right',
		  	columnWidth : .17,
		  	items:[contractComboBox,leftJob]
		},{
			layout : 'form',
		  	labelWidth : 80,
		  	labelAlign : 'right',
		  	columnWidth : .18,
		  	items:[startDate,isFormal]
		},{
			layout : 'form',
		  	labelWidth : 20,
		  	labelAlign : 'right',
		  	columnWidth : .15,
		  	items:[endDate]
		},{
			layout : 'form',
		  	labelWidth : 0,
		  	labelAlign : 'right',
		  	columnWidth : .18,
		  	items:[{
	  			layout : 'column',
				labelAlign : 'right',
				items:[{
					layout : 'form',
				  	labelWidth : 10,
				  	labelAlign : 'right',
				  	columnWidth : .4,
				  	items:[
				  		{xtype:'button',width:70,text:'查询',handler:search},
				  		{height:4},
				  		{xtype:'button',width:70,text:'导出Excel',handler:exportExcel}
				  	]
				},{
					layout : 'form',
				  	labelWidth : 10,
				  	labelAlign : 'right',
				  	columnWidth : .6,
				  	items:[
				  		{xtype:'button',width:70,text:'重置',handler:function() {
				  				Ext.getCmp("eName").setValue("");
					  			Ext.getCmp("workID").setValue("");
					  			Ext.getCmp("starLevel").setValue("");
					  			Ext.getCmp("term").setValue("");
					  			Ext.getCmp("contract").setValue("");
					  			Ext.getCmp("leftJob").setValue("");
					  			Ext.getCmp("startDate").setValue("");
					  			Ext.getCmp("endDate").setValue("");
					  			Ext.getCmp("isFormal").setValue("");
							}
						}
				    ]
				}]
			}]
		}],
		keys: {
            key: 13,
            fn: search
        }
	});
	
	/**
	 * 用户列表
	 */
	var basegrid = new Ext.grid.GridPanel( {
		id :'basegrid',
		store :store,
		split :true,
		bodyStyle:'5px 15px 0',
		region :'center',
		border :false,
		enableColumnMove:false,                                           
//	  	enableHdMenu:false,
		frame :false,
		autoScroll :true,
    	columns: [
     	            new Ext.grid.RowNumberer(),
    	          	{id:'workID',name:'workID', header:'工号',width:80,sortable:true,enableColumnMove:false,enableHdMenu:false,enableColumnResize :false, dataIndex: 'WORKID'},
    	          	{id:'eName',name:'eName',header:'姓名',width:70,sortable:true,enableColumnMove:false,enableHdMenu:false,enableColumnResize :false, dataIndex: 'ENAME'},
    	          	{header:'性别',width:40,sortable:true,enableColumnMove:false,enableHdMenu:false,enableColumnResize :false, dataIndex: 'SHOW_SEX'},
    	          	{header:'所属部门',width:60,sortable:true,enableColumnMove:false,enableHdMenu:false,enableColumnResize :false, dataIndex: 'SHOW_DEPT'},
    	          	{header:'岗位',width:60,sortable:true,enableColumnMove:false,enableHdMenu:false,enableColumnResize :false, dataIndex: 'SHOW_POST'},
    	          	{header:'职务',width:60,sortable:true,enableColumnMove:false,enableHdMenu:false,enableColumnResize :false, dataIndex: 'SHOW_DUTIES'},
    	          	{header:'组别',width:60,sortable:true,enableColumnMove:false,enableHdMenu:false,enableColumnResize :false, dataIndex: 'SHOW_TERM'},
    	          	{id:'birthday',name:'birthday',header:'出生年月',width:70,sortable:true,enableColumnMove:false,enableHdMenu:false,enableColumnResize :false, dataIndex: 'BIRTHDAY'},
    	          	{id:'age',name:'age',header:'年龄',width:40,sortable:true,enableColumnMove:false,enableHdMenu:false,enableColumnResize :false, dataIndex: 'AGE'},
    	          	{id:'height',name:'height',header:'身高',width:40,sortable:true,enableColumnMove:false,enableHdMenu:false,enableColumnResize :false, dataIndex: 'HEIGHT',renderer:function (val){if (val=='0'){return '';}else {return val;}}},
    	          	{id:'sino',name:'sino',header:'社会保险号',width:160,sortable:true,enableColumnMove:false,enableHdMenu:false,enableColumnResize :false, dataIndex: 'SINO'},
    	          	{id:'icno',name:'icno',header:'身份证号',width:160,sortable:true,enableColumnMove:false,enableHdMenu:false,enableColumnResize :false, dataIndex: 'ICNO'},
    	          	{id:'rprAdd',name:'rprAdd',header:'户籍地址',width:300,sortable:true,enableColumnMove:false,enableHdMenu:false,enableColumnResize :false, dataIndex: 'RPRADD'},
    	          	{id:'liveAdd',name:'liveAdd',header:'现地址',width:300,sortable:true,enableColumnMove:false,enableHdMenu:false,enableColumnResize :false, dataIndex: 'LIVEADD'},
    	          	{id:'tel',name:'tel',header:'联系方式',width:100,sortable:true,enableColumnMove:false,enableHdMenu:false,enableColumnResize :false, dataIndex: 'TEL'},
    	          	{header:'合同性质',width:60,sortable:true,enableColumnMove:false,enableHdMenu:false,enableColumnResize :false, dataIndex: 'SHOW_CONTRACT'},
    	          	{header:'用工形式',width:80,sortable:true,enableColumnMove:false,enableHdMenu:false,enableColumnResize :false, dataIndex: 'SHOW_EPMODE'},
    	          	{id:'arrDate',name:'arrDate',header:'到本单位时间',width:90,sortable:true,enableColumnMove:false,enableHdMenu:false,enableColumnResize :false, dataIndex: 'ARRDATE'},
    	          	{id:'signDate',name:'signDate',header:'订立合同时间',width:90,sortable:true,enableColumnMove:false,enableHdMenu:false,enableColumnResize :false, dataIndex: 'SIGNDATE'},
    	          	{id:'limitDate',name:'limitDate',header:'合同到期时间',width:90,sortable:true,enableColumnMove:false,enableHdMenu:false,enableColumnResize :false, dataIndex: 'LIMITDATE'},
    	          	{id:'workAge',name:'workAge',header:'工龄',width:40,sortable:true,enableColumnMove:false,enableHdMenu:false,enableColumnResize :false, dataIndex: 'WORKAGE',renderer:function (val){if (val=='0'){return '';}else {return val;}}},
    	          	{header:'是否离职',width:60,sortable:true,enableColumnMove:false,enableHdMenu:false,enableColumnResize :false, dataIndex: 'SHOW_LEFTJOB'},
    	          	{id:'fRelation',name:'fRelation',header:'家庭成员关系',width:90,sortable:true,enableColumnMove:false,enableHdMenu:false,enableColumnResize :false, dataIndex: 'FRELATION'},
    	          	{id:'fName',name:'fName',header:'家庭成员姓名',width:90,sortable:true,enableColumnMove:false,enableHdMenu:false,enableColumnResize :false, dataIndex: 'FNAME'},
    	          	{id:'fAge',name:'fAge',header:'家庭成员年龄',width:90,sortable:true,enableColumnMove:false,enableHdMenu:false,enableColumnResize :false, dataIndex: 'FAGE'},
    	          	{id:'fUnits',name:'fUnits',header:'工作单位',width:200,sortable:true,enableColumnMove:false,enableHdMenu:false,enableColumnResize :false, dataIndex: 'FUNITS'},
    	          	{header:'员工星级',width:60,sortable:true,enableColumnMove:false,enableHdMenu:false,enableColumnResize :false, dataIndex: 'SHOW_STARLEVEL'},
    	          	{header:'政治面貌',width:80,sortable:true,enableColumnMove:false,enableHdMenu:false,enableColumnResize :false, dataIndex: 'SHOW_PVISAGE'},
    	          	{id:'tPost',name:'tPost',header:'技术职称',width:100,sortable:true,enableColumnMove:false,enableHdMenu:false,enableColumnResize :false, dataIndex: 'TPOST'},
    	          	{id:'gsch',name:'gsch',header:'毕业院校',width:200,sortable:true,enableColumnMove:false,enableHdMenu:false,enableColumnResize :false, dataIndex: 'GSCH'},
    	          	{header:'文化程度',width:80,sortable:true,enableColumnMove:false,enableHdMenu:false,enableColumnResize :false, dataIndex: 'SHOW_EDUCATION'},
    	          	{header:'导游证情况',width:100,sortable:true,enableColumnMove:false,enableHdMenu:false,enableColumnResize :false, dataIndex: 'SHOW_CCARD'},
    	          	{header:'英语等级',width:80,sortable:true,enableColumnMove:false,enableHdMenu:false,enableColumnResize :false, dataIndex: 'SHOW_ELEVEL'},
    	          	{header:'普通话等级',width:80,sortable:true,enableColumnMove:false,enableHdMenu:false,enableColumnResize :false, dataIndex: 'SHOW_MLEVEL'},
    	          	{id:'special',name:'special',header:'专业',width:80,sortable:true,enableColumnMove:false,enableHdMenu:false,enableColumnResize :false, dataIndex: 'SPECIALTY'},
    	          	{id:'inDate',name:'inDate',header:'进校时间',width:70,sortable:true,enableColumnMove:false,enableHdMenu:false,enableColumnResize :false, dataIndex: 'INDATE'},
    	          	{id:'graduation',name:'graduation',header:'毕业时间',width:70,sortable:true,enableColumnMove:false,enableHdMenu:false,enableColumnResize :false, dataIndex: 'GRADUATION'},
    	          	{id:'agreement',name:'agreement',header:'与学校协议时间',width:95,sortable:true,enableColumnMove:false,enableHdMenu:false,enableColumnResize :false, dataIndex: 'AGREEMENT'},
    	          	{id:'endDate',name:'endDate',header:'结束实习/兼职时间',width:110,sortable:true,enableColumnMove:false,enableHdMenu:false,enableColumnResize :false, dataIndex: 'ENDDATE'},
    	          	{id:'teacher',name:'teacher',header:'实习老师',width:70,sortable:true,enableColumnMove:false,enableHdMenu:false,enableColumnResize :false, dataIndex: 'TEACHER'},
    	          	{header:'是否购买保险',width:90,sortable:true,enableColumnMove:false,enableHdMenu:false,enableColumnResize :false, dataIndex: 'SHOW_INSURANCE'},
    	          	
    	          	{id:'specialty',name:'specialty',header:'特长',width:80,sortable:true,enableColumnMove:false,enableHdMenu:false,enableColumnResize :false, dataIndex: 'SPECIALTY'},
    	          	{id:'rp',name:'rp',header:'奖惩情况',width:300,sortable:true,enableColumnMove:false,enableHdMenu:false,enableColumnResize :false, dataIndex: 'RP'},
    	          	{id:'remarked',name:'remarked',header:'备注',width:300,sortable:true,enableColumnMove:false,enableHdMenu:false,enableColumnResize :false, dataIndex: 'REMARKED'}
    	          	
//    	          	{id:'eid',name:'eid', header:'雇员编号',enableColumnMove:false,sortable:true,hidden:true,hideCollapseTool:false, enableHdMenu:false,enableColumnResize :false,dataIndex: 'EID'},
//    	          	{id:'sex',name:'sex',header:'性别',width:40,sortable:true,hidden:true,enableColumnMove:false,enableHdMenu:false,enableColumnResize :false, dataIndex: 'SEX'},
//    	          	{id:'dept',name:'dept',header:'所属部门',width:70,sortable:true,hidden:true,enableColumnMove:false,enableHdMenu:false,enableColumnResize :false, dataIndex: 'DEPT'},
//    	          	{id:'post',name:'post',header:'岗位',width:60,sortable:true,hidden:true,enableColumnMove:false,enableHdMenu:false,enableColumnResize :false, dataIndex: 'POST'},
//    	          	{id:'duties',name:'duties',header:'职务',width:60,sortable:true,hidden:true,enableColumnMove:false,enableHdMenu:false,enableColumnResize :false, dataIndex: 'DUTIES'},
//    	          	{id:'term',name:'term',header:'组别',width:60,sortable:true,hidden:true,enableColumnMove:false,enableHdMenu:false,enableColumnResize :false, dataIndex: 'TERM'},
//    	          	{id:'contract',name:'contract',header:'合同性质',width:60,sortable:true,hidden:true,enableColumnMove:false,enableHdMenu:false,enableColumnResize :false, dataIndex: 'CONTRACT'},
//    	          	{id:'epMode',name:'epMode',header:'用工形式',width:80,sortable:true,hidden:true,enableColumnMove:false,enableHdMenu:false,enableColumnResize :false, dataIndex: 'EPMODE'},
//    	          	{id:'starLevel',name:'starLevel',header:'员工星级',width:60,sortable:true,hidden:true,enableColumnMove:false,enableHdMenu:false,enableColumnResize :false, dataIndex: 'STARLEVEL'},
//    	          	{id:'pVisage',name:'pVisage',header:'政治面貌',width:80,sortable:true,hidden:true,enableColumnMove:false,enableHdMenu:false,enableColumnResize :false, dataIndex: 'PVISAGE'},
//    	          	{id:'education',name:'education',header:'文化程度',width:80,sortable:true,hidden:true,enableColumnMove:false,enableHdMenu:false,enableColumnResize :false, dataIndex: 'EDUCATION'},
//    	          	{id:'cCard',name:'cCard',header:'导游证情况',width:100,sortable:true,hidden:true,enableColumnMove:false,enableHdMenu:false,enableColumnResize :false, dataIndex: 'CCARD'},
//    	          	{id:'eLevel',name:'eLevel',header:'英语等级',width:80,sortable:true,hidden:true,enableColumnMove:false,enableHdMenu:false,enableColumnResize :false, dataIndex: 'ELEVEL'},
//    	          	{id:'mLevel',name:'mLevel',header:'普通话等级',width:80,sortable:true,hidden:true,enableColumnMove:false,enableHdMenu:false,enableColumnResize :false, dataIndex: 'MLEVEL'},
//    	          	{id:'photo',name:'photo',header:'照片路径',width:300,sortable:true,hidden:true,enableColumnMove:false,enableHdMenu:false,enableColumnResize :false, dataIndex: 'PHOTO'}
//    	          	{id:'leftJob',name:'leftJob',header:'是否离职',width:60,sortable:true,hidden:true,enableColumnMove:false,enableHdMenu:false,enableColumnResize :false, dataIndex: 'LEFTJOB'},
//    	          	{id:'insurance',name:'insurance',header:'是否购买保险',width:90,sortable:true,hidden:true,enableColumnMove:false,enableHdMenu:false,enableColumnResize :false, dataIndex: 'INSURANCE'},
    	]
	});

	var mainPanel = new Ext.Panel({
            id: 'mainPanel',
            region:'center',
            split:true,
            border:false,
            frame:true,
            layout: 'border',  
            items:[searchPanel,basegrid]
    });
    
	var viewport = new Ext.Viewport( {
		layout:'border',
		items: [mainPanel ]
	});
	
	function search(){
		if(Ext.getCmp("startDate").getValue() > Ext.getCmp("endDate").getValue()) {
			Ext.getCmp("startDate").markInvalid("订立合同开始时间必须小于结束时间");
			return false;
		}
		
		mainPanel.body.mask('正在加载数据...','x-mask-loading');
		var obj = new Object();
		obj.eName = Ext.getCmp("eName").getValue();
		obj.workID = Ext.getCmp("workID").getValue();
		obj.starLevel = Ext.getCmp("starLevel").getValue();
		obj.term = Ext.getCmp("term").getValue();
		obj.contract = Ext.getCmp("contract").getValue();
		obj.leftJob = Ext.getCmp("leftJob").getValue();
		obj.startDate = Ext.getCmp("startDate").getValue();
		obj.endDate = Ext.getCmp("endDate").getValue();
		obj.isFormal = Ext.getCmp("isFormal").getValue();
		
    	var url=clsUrl+'&methodName=getEmployee&paramCount=0'
		Ext.http.send(url,function(res){
			basegrid.store.loadData(Ext.decode(res));
			mainPanel.body.unmask();
		},Ext.encode(obj));
	}
	
	function exportExcel() {
		var vExportContent = basegrid.getExcelXml(); // 获取数据
		if (Ext.isIE6 || Ext.isIE7 || Ext.isIE8 || Ext.isSafari || Ext.isSafari2 || Ext.isSafari3) { // 判断浏览器
			var fd = Ext.get('frmDummy');
			if (!fd) {
				fd = Ext.DomHelper.append(Ext.getBody(), {
							tag : 'form',
							method : 'post',
							id : 'frmDummy',
							action : exportUrl,
							target : '_blank',
							name : 'frmDummy',
							cls : 'x-hidden',
							cn : [{
										tag : 'input',
										name : 'exportContent',
										id : 'exportContent',
										type : 'hidden'
									}]
						}, true);
			}
			fd.child('#exportContent').set({
						value : vExportContent
					});
			fd.dom.submit();
		} else {
			document.location = 'data:application/vnd.ms-excel;base64,'+ Base64.encode(vExportContent);
		}
	}
	
	store.on('beforeload',function(thiz,options){
		mainPanel.body.mask('正在加载数据','x-mask-loading');
    });
    
	store.on("load",function(){
		mainPanel.body.unmask();
	});
	
	store.load();
});